package main

import (
				"awesomeProject1/addlatch"
				"fmt"
)

func main() {
/*
	countlatch := countlatch.GetInstance(2)
	cylicbarrier := cylicbarrier.GetInstance(3)
	go func() {
		cylicbarrier.Wait()
		fmt.Println("after")
		countlatch.Count()
	}()
	go func() {
		cylicbarrier.Wait()
		fmt.Println("after")
		countlatch.Count()
	}()
	time.Sleep(time.Duration(2) * time.Second)
	cylicbarrier.Wait()
	fmt.Println("after")
	countlatch.Wait()*/

				latch := addlatch.GetInstance(3)
				go func() {
								i := 1
								latch.Add(i)
				}()
				go func() {
								i := 2
								latch.Add(i)
				}()
				go func() {
								i := 3
								latch.Add(i)
				}()
				latch.Wait()
				for index := range latch.List {
								fmt.Println(latch.List[index])
				}
}
